package kazan.fujitsu.lab.l11;

import java.io.File;
import java.io.FileReader;
import java.io.PrintWriter;
import java.util.Scanner;

import kazan.fujitsu.lab.l11.model.Data;

/**
 * @author ayratn
 */
public class MainSolutionImpl implements MainSolution {

    /**
     * Should be equal to "YES" or "NO".
     */
    private String result;
    
    /**
     * {@inheritDoc}
     */
    public Data readData() throws Exception {
    	Scanner sc=new Scanner(new FileReader("input.txt"));
    	Data d=new Data();
    	d.setX1(sc.nextInt());
    	d.setX2(sc.nextInt());
    	d.setX3(sc.nextInt());
    	d.setX4(sc.nextInt());
    	sc.close();
        return d;
    }

    /**
     * {@inheritDoc}
     */
    public void solve(Data data) throws Exception {
        boolean y1 = data.getX1() <= data.getX3();
        boolean y2 = data.getX1() <= data.getX4();
        boolean y3 = data.getX2() <= data.getX3();
        boolean y4 = data.getX2() <= data.getX4();
        boolean y5 = data.getX3() <= data.getX2();
        boolean y6 = data.getX4() <= data.getX2();
        boolean y7 = data.getX3() <= data.getX1();
        boolean y8 = data.getX4() <= data.getX1();

        if ((y1 && (y5 || y6 || y8)) || (y2 && (y5 || y6 || y7))
                || (y3 && (y7 || y8 || y6)) || (y4 && (y7 || y8 || y5))) {
            result = "YES";
        } else {
            result = "NO";
        }
    }

    /**
     * {@inheritDoc}
     */
    public void writeAnswer() throws Exception {
    	
    	PrintWriter pr = new PrintWriter(new File("output.txt"));
    	
    	pr.println(result);
    	pr.close();
    	
    }

    public static void main(String... args) throws Exception {
        MainSolutionImpl solver = new MainSolutionImpl();
        Data data = solver.readData();
        solver.solve(data);
        solver.writeAnswer();
    }

}
